var express = require("express");
var router = express.Router();
const userController = require("../controller/userController");
const requireAuth = require("../middleware/requireAuth");

//挂载路由

// 注册
// router.route("/signup").post(userController.addUser);

//注册
router.post("/signup", userController.signup);

//登录
router.post("/signin", userController.signin);

router.get("/group", userController.getAllGroup);

//获取当前登录用户
// router.get("/usermessage", requireAuth, userController.getUser);

router.get("/allUser", requireAuth, userController.getAllUser);

//修改用户信息（不包括密码）
router.patch("/update/:id", requireAuth, userController.updateUser);

//修改用户密码
router.patch("/forgetPassword", userController.forgetPassword);

module.exports = router;
